package com.brspace.qualitycontrol.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.brspace.qualitycontrol.entity.CollectWrit;
import com.brspace.qualitycontrol.entity.Publish;
import com.brspace.qualitycontrol.entity.vo.MonthNumVo;
import com.brspace.qualitycontrol.entity.vo.PaginationVo;
import com.brspace.qualitycontrol.entity.vo.PublishVo;
import com.brspace.qualitycontrol.utils.R;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 发文拟稿 服务类
 * </p>
 *
 * @author ${author}
 * @since 2021-04-02
 */
public interface PublishService extends IService<Publish> {
    /**
     * 新建发文
     * @param publish
     * @return
     */
    R addPub(Publish publish );

    /**
     * 发文列表
     * @param pageParam
     * @param publishVo
     * @return
     */
    IPage<Publish> selectPage(Page<Publish> pageParam, PublishVo publishVo,String userId);

    //分页查询当前用户未阅发文列表
    PaginationVo<Publish> getPostList(Integer pageNum, Integer pageSize, String userId, int i);

    //每月统计发文数量
    List<MonthNumVo> statisticsByMonth();

    //计算今年发文数量和去年发文数量
    R getNowAndLastNum();

    //发文类型统计列表
    R getTypeNumList();

    //保存文件并返回数据
    R savePublish(HttpServletRequest request, HttpServletResponse response, Publish publish);

    String examine(Publish publish,String nextId,String userId);

    List<Publish> pageList(int page, int limit, String userId);

    List<Publish> pageCompleteList(int page, int limit, String userId);

    List<Publish> pageAllList(int page, int limit, String userId);
}
